package com.itoken.feign.hystrix;

import com.google.common.collect.Lists;
import com.itoken.common.constant.HttpStatusCodeEnum;
import com.itoken.common.dto.BaseResult;
import com.itoken.feign.service.UserService;
import org.springframework.stereotype.Component;

/**
 * Created by 蔡超 on 2019/1/17.
 */
@Component
public class UserServiceHystrix implements UserService {

    @Override
    public BaseResult login(String loginName, String password) {
        return BaseResult.notOK(Lists.newArrayList(
                new BaseResult.Error(
                        String.valueOf(HttpStatusCodeEnum.Hystrix.getCode()),
                        HttpStatusCodeEnum.Hystrix.getValue())));
    }

    @Override
    public String sayHi(String message) {
        return "say hi Hystrix";
    }

}
